home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / N_Node.3T < prev    next >
Text File  |  1992-06-26  |  5KB  |  201 lines

  1. .TH N_NODE
  2. .SH NAME
  3. N_Node<Type,nchild> \f1 Parameterized static-sized n-ary node class
  4. .SH SYNOPSIS
  5. #include <cool/N_Node.h>
  6. .SH DESCRIPTION
  7. The \f3N_Node<Type,nchild>\f1 class implements parameterized nodes of a static size 
  8. for n-ary trees. This node class is parameterized for both the type and some 
  9. initial number of subtrees that each node may have. The constructors for the 
  10. \f3N_Node<Type,nchild>\f1 class are declared in the public section to allow the user 
  11. to create nodes and control the building and structure of an n-ary tree where 
  12. the ordering can have a specific meaning, as with an expression tree.
  13. .SH Base Classes
  14. None
  15. .SH Friend Classes
  16. \f3N_Tree<Node,Type,nchild>
  17. .SH Public Constructors
  18. .TP
  19. \f3N_Node<Type,nchild> ();\f1
  20. Allocates an N-node with all subtree pointers set to 
  21.  
  22.  NULL .
  23. .TP
  24. \f3N_Node<Type,nchild> (const Type& value\f3);\f1
  25. Allocates an N-node with all subtree pointers set to 
  26.  
  27.  NULL
  28. and initializes the 
  29. value of the node to 
  30.  value .
  31. .TP
  32. \f3N_Node<Type,nchild> (const N_Node<Type,nchild>& nn\f3);\f1
  33. Duplicates the value of another N-node object 
  34.  nn .
  35. .SH Member Functions
  36. .TP
  37.  inline Type& get () const;
  38. Returns a reference to the value of the data member.
  39. .TP
  40. \f3Boolean insert_after (N_Node<Type,nchild>& nn\f3, int \f2index\f3);\f1
  41. Inserts a subtree pointer to 
  42.  nn 
  43. after the zero-relative 
  44.  index 
  45. given. This 
  46. function returns
  47.  
  48.  TRUE 
  49. if successful; otherwise, this function returns 
  50.  
  51.  FALSE . 
  52. If 
  53.  index 
  54. is negative or out of range, an 
  55.  \f3\f3Error\f1\f1 
  56. exception is raised.
  57. .TP
  58. \f3Boolean insert_before (N_Node<Type,nchild>& nn\f3, int \f2index\f3);\f1
  59. Inserts a subtree pointer to 
  60.  nn 
  61. before the zero-relative 
  62.  index . 
  63. This function 
  64. returns 
  65.  
  66.  TRUE  
  67. if successful; otherwise, this function returns
  68.  
  69.  FALSE . 
  70. If 
  71.  index 
  72. is 
  73. negative or out of range, an 
  74.  \f3\f3Error\f1\f1 
  75. exception is raised.
  76. .TP
  77.  Boolean is_leaf () const;
  78. Determines if the node is a terminal node by evaluating the subtree pointers. 
  79. If all pointers are 
  80.  
  81.  NULL , 
  82. this function returns 
  83.  
  84.  TRUE ; 
  85. otherwise, this function returns 
  86.  
  87.  FALSE .
  88. .TP
  89.  inline int num_subtrees () const;
  90. Returns the maximum number of subtrees possible for a node.
  91. .TP
  92. \f3N_Node<Type,nchild>& \f3operator= (N_Node<Type,nchild>& nn\f3);\f1
  93. Overloads the assignment operator for the class to assign the values of the 
  94. subtree pointers and the value in 
  95.  nn 
  96. to the node object. This function returns 
  97. a reference to the updated node.
  98. .TP
  99. \f3inline Boolean operator== (const Type& value\f3) const;\f1
  100. Overloads the equality operator for the \f3N_Node<Type> \f1class. This function returns 
  101.  
  102.  TRUE 
  103. if \f2value\f1 is equal to the value of the node object; otherwise, this 
  104. function returns 
  105.  
  106.  FALSE .
  107. .TP
  108. \f3inline Boolean operator!= (const Type& value\f3) const;\f1
  109. Overloads the inequality operator for the \f3N_Node<Type>\f1 class. This function 
  110. returns 
  111.  
  112.  TRUE 
  113. if 
  114.  value 
  115. is not equal to the value of the node object; otherwise, 
  116. this function returns 
  117.  
  118.  FALSE .
  119. .TP
  120. \f3inline Boolean operator< (const Type& value\f3) const;\f1
  121. Overloads the less-than operator for the \f3N_Node<Type>\f1 class. This function 
  122. returns 
  123.  
  124.  TRUE 
  125. if 
  126.  value 
  127. is less than the value of the node object; otherwise, 
  128. this function returns 
  129.  
  130.  FALSE .
  131. .TP
  132. \f3inline Boolean operator<= (const Type& value\f3) const;\f1
  133. Overloads the less-than-or-equal operator for the \f3N_Node<Type>\f1 class. This 
  134. function returns 
  135.  
  136.  TRUE 
  137. if 
  138.  value 
  139. is less than or equal to the value of the node 
  140. object; otherwise, this function returns 
  141.  
  142.  FALSE.
  143. .TP
  144. \f3inline Boolean operator> (const Type& value\f3) const;\f1
  145. Overloads the greater-than operator for the \f3N_Node<Type>\f1 class. This function returns 
  146.  
  147.  TRUE
  148. if 
  149.  value 
  150. is greater than the value of the node object; otherwise, 
  151. this function returns 
  152.  
  153.  FALSE .
  154. .TP
  155. \f3inline Boolean operator>= (const Type& value\f3) const;\f1
  156. Overloads the greater-than-or-equal operator for the \f3N_Node<Type> \f1class. This 
  157. function returns 
  158.  
  159.  TRUE 
  160. if 
  161.  value 
  162. is greater than or equal to the value of the 
  163. node object; otherwise, this function returns 
  164.  
  165.  FALSE .
  166. .TP
  167. \f3inline N_Node<Type,nchild>*& \f3operator[\^] (int \f2index\f3);\f1
  168. Returns a reference to a pointer to the subtree at the zero-relative 
  169.  index . 
  170. If 
  171.  index 
  172. is negative or out of range, an 
  173.  \f3\f3Error\f1\f1 
  174. exception is raised.
  175. .TP
  176. \f3inline void set (const Type& value\f3);\f1
  177. Sets the value of the data member in the node to 
  178.  value .
  179. .TP
  180. \f3inline void set_compare (\f2N_Node_Compare \f3= NULL);\f1
  181. Sets the comparison function that is to be used in all comparison tests. 
  182.  N_Node_Compare
  183. is a function of type 
  184.  Boolean 
  185. (\f2*Function\f1)(\f3const Type&\f1, \f3const Type&\f1). If no argument is provided, the 
  186.  operator== 
  187. for the type over which the 
  188. class is parameterized is used.
  189. .SH COPYRIGHT
  190.  
  191. Copyright (C) 1991 Texas Instruments Incorporated.
  192.  
  193. Permission is granted to any individual or institution to use, copy, modify,
  194. and distribute this software, provided that this complete copyright and
  195. permission notice is maintained, intact, in all copies and supporting
  196. documentation.
  197.  
  198. Texas Instruments Incorporated provides this software "as is" without
  199. express or implied warranty.
  200.  
  201.